<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <title>list</title>
        <script>
            window.onload = function () {
                let aLi = document.querySelectorAll('li');
                // 它是一个HTMLCollection，它也有长度，类似数组，但不是真正的数组
                // console.log(aLi);
                let liArr = Array.from(aLi, (item, index) => {
                    // console.log(index, item);
                    // string
                    // console.log(typeof (item.innerHTML));
                    item.style.backgroundColor = 'purple';
                });
            };
        </script>
    </head>
    <body>
        <ul>
            <li>11111111</li>
            <li>22222222</li>
            <li>33333333</li>
            <li>44444444</li>
            <li>55555555</li>
        </ul>
    </body>
</html>
